Some HTML authoring tools will insert <CR><LF>
pairs within an activator tag in an effort to make the string fit within an 80-character limit. This break is usually placed between the initial "A" and the subsequent "HREF". Sapphire/Web will not "see" such activators. The cure for this somewhat perverse activity is to remove all such breaks with a text editor, such as the tag editor that comes with Sapphire/Web.
If you place a data site as the very first characters in an HTML file - as an include used with an Sa_FILE=
tag, perhaps - it will not be "seen" by Sapphire/Web. To avoid this, place some spaces or blank lines first.
You can achieve this with a form in the following way:
In the bind code editor (initialization section), initialize a variable:
char* value;In the before object bind code, make an assignment:
value = SaGetInputValue("FormElementName");Add something like this to your HTML for each field that you wish to populate:
<INPUT NAME="test" TYPE=text VALUE=##Sa_datasitename##>and use
SaRegisterStringSite(HtmlTemplate,"test",value)to populate the datasite.
You must make the results template for the bind the same as the original HTML template or make it an identical copy. This will give the appearance that the fields were updated, but in reality the entire page was regenerated.
##Sa_DataSiteName##
.
char* LocalVarValue ... LocalVarValue="some value" SaRegisterStringSite(NULL,"datasitename",LocalVarValue)For detailed information on this API, please see the Reference Manual, Chapter 2. This will populate the datasite with the value of the local variable LocalVarValue.
SaRegStdErrSite
. This function will send all errors to a Data Site in your HTML template with the name ##Sa_ErrorSite##
. If you want a different name for your standard error site, use the function SaRegErrSite
. This uses the SaRegErrSite
function internally. You can look at the code for these functions in the file SaHtmlC.c
in the directory client/src
in the Sapphire/Web distribution.